<div id="check" style="height:64px;">
	<div class="<php>if($ischeck){</php>sign-in-h<php>}else{</php>sign-in<php>}</php>" id="checkdiv">
		<span class="datetime">
	    <i class="ico-calendar"></i>
	    <!--<em class="date">{$day}</em>
		<em class="week">{$week}</em>-->
	    </span>
	    <php>if($ischeck){</php>
	    <em id="checkin" class="btn-sign-h">已签到&nbsp;<span class="number">{$con_num}day</span></em>
	<php>}else{</php>
	<em href="javascript:void(0)" id="checkin" onclick="checkin()" class="btn-sign">每日签到</em>
	<php>}</php>

		<div class="sign-wrap" style="display:none" id="checkdetail">
		  <i class="arrow-y"></i>
		  <div class="sign-box">
		    <h3 id="checkinfo"><php>if($ischeck){</php>签到成功，获取积分{$credit.score}分<php>}else{</php>未签到<php>}</php></h3>
		    <div class="sign-info"><p>已连续签到<font id="con_num">{$con_num}</font>天，累计签到<font id="total_num">{$total_num}</font>天</p></div>
		  </div>
		</div>
	</div>
</div>
<div class="clearfix mb20 pb20 border-b" style="display:none;">
	<a href="{:U('public/')}"
	<a href="{:U('public/Task/index')}" class="btn-task left" target="_blank"><span>做任务</span></a>
	<a href="{:U('public/Rank/index')}" class="btn-account right" target="_blank"><span>比排名</span></a>
</div>



<script>
var isshow = 1;
$(function (){
	<php>if($ischeck){</php>
	$('#check').hover(function (){
		$("#check").stop().animate({
			height:'140px'
		},500);
		$('#checkdetail').show();
		$('#checkdetail').stop().animate({
			opacity: 1
		},500);
	},function (){
		$("#check").stop().animate({
			height:'64px'
		});
		$('#checkdetail').stop().animate({
			opacity: 0
		},500);
	});
	<php>}</php>
});
function checkin(){
	//未登录
	if( MID == 0 ){
		ui.quicklogin();
		return;
	}
	var totalnum = {$total_num} + 1;
	var credit_score = "{$credit.score}";
	$.post(U('widget/CheckIn/check_in') , {} , function (res){
		if ( res ){
			var connum = res;

			$('#checkin').html('已签到&nbsp;<span class="number">'+connum+'day</span>');
			$('#checkin').attr('class' , 'btn-sign-h');
			$('#checkdiv').attr('class' , 'sign-in-h' )
			$('#checkinfo').text('签到成功，获取积分' + credit_score + '分');

			$('#con_num').text(connum);
			$('#con_num_day').text(connum);
			$('#total_num').text(totalnum);
			$('#check').hover(function (){
				$("#check").stop().animate({
					height:'140px',
				},500);
				$('#checkdetail').show();
				$('#checkdetail').stop().animate({
					opacity: 1,
				},500);
			},function (){
				$("#check").stop().animate({
					height:'64px',
				});
				$('#checkdetail').stop().animate({
					opacity: 0,
				},500);
			});
		}
	});
}
</script>